Extensible Stylesheet Language (XSL) transformation is an important application of Extensible Markup Language (XML). XSLT (Extensible Stylesheet Language Transformation) is a language for this kind of transformation. An XSL style sheet in XSLT describes how an XML document is transformed into another XML document. Existing XSLT processors use either an interpreter or traditional compiler model to perform XSL transformation. Previous attempts to improve the efficiency of XML transformation include the use of an abstract machine, or abstract stack machine (ASM). An ASM uses ASM byte codes and an evaluator to implement the semantic representation of these byte codes.
FIG. 1 shows a framework of a processing environment implementing an abstract stack machine, such as the one discussed above. An XSLT style sheet 102 is compiled into ASM codes 114 by ASM compiler 112. ASM codes 114 are sent as input to the abstract stack machine, ASM 120. XML input document 104 (i.e., the document to be transformed) is also input to ASM 120. ASM codes 114 provide the instructions to traverse XML input document 104, select item sets from the XML document tree (created by XML tree navigator 116) and perform XSL instructions on the selected item sets. ASM 120 has its own specialized registers group 122 to record transformation context along with a memory manager 124 to hold temporary computation results.
ASM 120 interacts with various modules (e.g., output builder 130, XML tree navigator 116, pattern matcher 118, etc) to finish the transformation. These modules are loosely coupled with ASM 120. The modules can be replaced by other implementations that are consistent with the interface of ASM 120. For example, a more compact binary XML data format can be used to support large files. In such an example, encoding and implementation are encapsulated into XML tree navigator 116 and only need to provide traversal methods to ASM 120. ASM codes 114 are executed in an interpreting mode. In other words, ASM 120 interprets each ASM code one by one at runtime.
Descriptions of certain details and implementations follow, including a description of the figures, which may depict some or all of the embodiments described below, as well as discussing other potential embodiments or implementations of the inventive concepts presented herein. An overview of embodiments of the invention is provided below, followed by a more detailed description with reference to the drawings.